package com.gitee.dupe.authority.service;

import com.gitee.dolt.boot.service.SuperCacheService;
import com.gitee.dupe.authority.entity.Resource;
import com.gitee.dupe.authority.enumeration.ResourceTypeEnum;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author LYH
 * @since 2020-06-30
 */
public interface IResourceService extends SuperCacheService<Resource> {

    /**
     * 获取用户可用权限
     *
     * @param userId
     * @return
     */
    List<Resource> findAllEnabledByUserId(Long userId);

    /**
     * 获取角色权限
     *
     * @param roleId
     * @return
     */
    List<Resource> findAllByRoleId(Long roleId);

    /**
     * 通过类型获取
     *
     * @param type
     * @return
     */
    List<Resource> findAllByType(ResourceTypeEnum type);

}
